home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The PC-SIG Library 9
/
The PC-SIG Library on CD ROM - Ninth Edition.iso
/
401_500
/
DISK0420
/
DISK0420.ZIP
/
LU.DOC
< prev
next >
Wrap
Text File
|
1984-03-25
|
6KB
|
149 lines
.he LU -- Library Utility for MSDOS T. Jennings 15 Jan 84 Page #
.op
LU is a utility to manipulate "LBR" files generated by
the CP/M utility of the same name, or any of the MSDOS compatible
ones. The most common use is to pack a group of related files
into a single LBR file, for modem transfers or for archiving.
LU or an equivelant program is usually required to
"unpack" the larger software packages available on public
Bulletin Board Systems.
LBR files are a special file generated by LU (or
whatever) that contain one or more DOS files, and a simple
directory. Whenever an existing library is changed (files changed
or deleted) the library requires "reorganizing". More on this
below.
LU operation is quite simple. Ther are only a few
commands. Each is described below, and a quick summary can be
obtained by running LU like so:
LU <cr>
OPERATING LU
LU commands, etc are entered on the command line after
the program name. You must ALWAYS enter a command letter, below,
and the name of an LBR file, followed by file names, if needed:
LU <command> <lbr file name> { <optional filenames> }
For example,
LU T FILE.LBR
Lists all the files contained within the LBR file
FILE.LBR.
L U C O M M A N D S
All LU commands are a single letter. Only one can be entered
at a time.
A Unpack all files from the library. This is the same as
the E (extract) command, followed by all the file names. Thi sis
much easier if all you want to do is remove all the files.
T List all files contained in the LBR file. Each filename
is listed, along with the size of the file in bytes, and its
starting offset within the LBR file. (The offset is pretty
useless information, but there it is.)
L Same as T.
E Extract a file from the library. The file(s) to be
extracted are entered after the LBR file name. Each file will be
extracted, and copied to a disk file of the same name.
U Update a library. This is also used to create new
libraries. File name(s) are entered after the LBR file name, and
each file is added to the library. Any file of the sam ename
already in the library will be deleted first, otherwise just
added. Pleas read about reorganizing, below.
If the library file does not exist (creating a new one)
then you are asked for the number of new slots for the library.
"Slots" means the maximum number of files that the LBR file can
contain. The number you enter is rounded up to the next highest
multiple of four; this is just a peculiarity of the LBR file
structure. It does not hurt anything. After the new library is
created, any specified files are added to it.
D Delete a file. The just marks the file within the library
as "deleted". The library file will NOT change in size; it does
not remove the data contained by the file. See "reorganization",
below.
R Reorganize the library. All free space (from deleted
files, or existing files that were Updated) is freed up, and the
LBR file generally becomes smaller. Should be used after a Delete
or Update command. Creates a temporary file called LU$$$$$$.TMP,
therfore you should not use this file name elsewhere.
R E O R G A N I Z I N G
The structure of an LBR file (described in detail below)
is very simple. Because of its simplicity, files that are deleted
or changed still consume space within the LBR file, which must be
"squeezed" whenever the library is changed.
Deleteing a file merely marks the file as "deleted"; it
does not remove the data contained in the LBR file. Updated files
are deleted first, and also consume space. Therefore, the library
must be reorganized. This consists of creating a new library, and
copying the active files to it, dropping out all the deleted or
changed data.
The rule is: reorganize after deleting a file, or
updating a file that already existed. If the library runs out of
slots, and you want to add more files, reorganize and specify a
larger number of slots. You can then add to the library.
Reorganizing never does any harm, in any case.
L B R F I L E S T R U C T U R E
The LBR file is a disk file that contains a simple
directory, followed by all the data contained in the files. New
files are added to the end of the LBR file, and the directory
entry for each file points to the data, and contains its length.
Each directory entry is:
00: file status (0= active, FF= deleted, FE= unused)
01: 11 character filename (FCB format)
12: 16 bit offset to start of data (in sectors)
14: 16 bit data length (in sectors)
16: 16 bytes of filler
Since the original program was written in BDS C, all
offsets and lengths are in multiples of 128 bytes, the CP/M
"sector size". LU multiplies these values by 128 before using.
(Also, all file sizes are rounded up to the nearest 128 bytes.)
The offset is the location of the data for the file,
relative to the start of the LBR file.
The first directory entry is the directory itself. The
filename is always blank, the offset is not used, and the length
is the length of the directory. Since the length is a multiple of
128, LU rounds up the number of slots when creating a new LBR
file to a multiple of four. (32 bytes per entry * 4 == 128).
P E C U L I A R I T I E S
There are only two peculiarities (nice way of saying
"bugs") that I know of: Filenames without extentions, like "FILE"
instead of "FILE.EXT" should be entered without a dot. Entering
with a dot wil cause "NOT FOUND" errors to be generated. (I.e.
use "FILE" not "FILE.". Two, not really a bug, but a side effect
of the original design: all files are rounded up to the nearest
128 bytes. This does not matter for most files, but some, like
spreadsheet files, will not work unless the size is exactly
right. LU (or equivalent) cannot be used with such files. Try it
and see what happens.